package com.aiju.base.fragment;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.aiju.base.activity.BaseActivity;
import com.aiju.bean.User;
import com.aiju.app.config.ConfigManager;
import com.aiju.widgit.dialog.DialogHelper;

/**
 * @auther:
 * @date:
 * @Description:
 */
public class BaseFragment extends AbsFragment {

    protected User mUser;

    protected BaseActivity mActivity;

    protected DialogHelper mDialogHelper;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        mActivity = (BaseActivity) activity;
        mDialogHelper = new DialogHelper(mActivity);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mUser = ConfigManager.getInstance().getUser();
    }

    /**
     * 跳转页面
     *
     * @param clas
     */
    public void startActivity(Class<?> clas) {
        startActivity(new Intent(getActivity(), clas));
    }

}
